import config from "@/config"
import http from "@/utils/request"

export default {
    addMenu: {
        url: `${config.API_URL}/platform/menu/add`,
        name: "新增菜单",
        post: function (menu) {
            return http.post(this.url, menu);
        }
    },
    delMenus: {
        url: `${config.API_URL}/platform/menu/del`,
        name: "多选级联删除菜单",
        delete: function (menuIds) {
            return http.delete(this.url, menuIds);
        }
    },
    editMenu: {
        url: `${config.API_URL}/platform/menu/edit`,
        name: "修改菜单信息",
        put: function (platformMenuEditVo) {
            return http.put(this.url, platformMenuEditVo);
        }
    },
    getMenuById: {
        url: `${config.API_URL}/platform/menu/info`,
        name: "根据ID获取树形菜单详情",
        get: function (menuId) {
            return http.get(this.url + '/' + menuId);
        }
    },
    listMenuByUser: {
        url: `${config.API_URL}/platform/menu/getMenuListByUser`,
        name: "根据用户ID获取该用户所拥有的树形菜单列表",
        get: function (userId) {
            return http.get(this.url + "/" + userId);
        }
    },
    pageListMenu: {
        url: `${config.API_URL}/platform/menu/pageList`,
        name: "分页查询树形菜单列表",
        get: function (platformMenuQueryVo) {
            return http.get(this.url, platformMenuQueryVo);
        }
    }
}
